package Controller.SCServlet;

import Dao.SCDao;
import bean.SC;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;

@WebServlet("/sc_delete")
public class sc_delete extends HttpServlet {
    SCDao scDao = new SCDao();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String sno = req.getParameter("sno");
        String con = req.getParameter("cno");

        ArrayList<SC> list =  scDao.delete(sno, con);
        req.setAttribute("scList",list);
        req.getRequestDispatcher("SCInfoSelect.jsp").forward(req,resp);

    }
}
